package com.buoy.base.aluminumpricespider.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 爬虫配置属性
 */
@Configuration
@ConfigurationProperties(prefix = "spider")
@Data
public class SpiderProperties {
    
    /**
     * 上海价格源
     */
    private String shanghaiPriceSource = "shanghai";
    
    /**
     * 长江价格源
     */
    private String changjiangPriceSource = "changjiang";

    /**
     * 南海
     */
    public static final String SOURCE_FROM_NANHAI = "nanhai";

    /**
     * 南储
     */
    public static final String SOURCE_FROM_NANCHU = "nanchu";

    /**
     * 上海铝价URL
     */
    private String shanghaiPriceUrl = "https://price.metal.com/Aluminum";
    
    /**
     * 长江铝价URL
     */
    private String changjiangPriceUrl = "https://www.lvdingjia.com/price/changjiang/";
    
    /**
     * 节假日API URL
     */
    private String holidayApiUrl = "http://timor.tech/api/holiday/info/";
    
    /**
     * 用户代理
     */
    private String userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36";
    
    /**
     * 请求超时时间（毫秒）
     */
    private int timeout = 30000;
} 